package com.my.util;

import com.my.bean.User;

import java.lang.reflect.Field;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Created by Zhang on 2018/9/10.
 *
 */
public class beanUtil {
    private static Collection<Field> getAllClassFields(Class clazz) {
        Map<String, Field> resutlMap = new LinkedHashMap<String, Field>();
        for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
            Field[] fields = clazz.getDeclaredFields();
            for (Field field : fields) {
                resutlMap.put(field.getName(), field);
            }
        }
        return resutlMap.values();
    }

    public  static  void  main(String [] args){

    }
}
